class Axios {
  constructor() {


  }
  request(config) {
    return new Promise((resolve, reject) => {
      const { url = '', method = 'get', data = {} } = config
      const xhr = new XMLHttpRequest()
      xhr.open(method, url, true)
      xhr.onload = function () {
        resolve(xhr.responseText)
      }
      xhr.send(data)
    })
  }
}

function createAxiosFn() {
  let axios = new Axios()
  let req = axios.request.bind(axios)
  return req
}